/* Stream - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.math.BigInteger;

public class Stream extends Node {
	public static int loginStage = 0;
	public static JString aClass3_1354;
	public static int[] anIntArray1355;
	public static JString aClass3_1356 = Class39_Sub5_Sub9.createJString(103, "An");
	public int currentOffset;
	public static CacheArchive aClass9_Sub1_1358;
	public static JString aClass3_1359;
	public static JString aClass3_1360;
	public static int anInt1361 = 0;
	public static Class9 aClass9_1362;
	public static JString aClass3_1363;
	public static int anInt1364;
	public static JString aClass3_1365;
	public static JString aClass3_1366;
	public byte[] buffer;
	public static int anInt1368;
	public static JString aClass3_1369;
	public static JString aClass3_1370;

	public void readBytesA(byte[] dest, int length, int offset) {
		for (int i_2_ = offset; i_2_ < length + offset; i_2_++)
			dest[i_2_] = (byte) (buffer[currentOffset++] - 128);
	}

	public static void method782(byte i) {
		aClass3_1365 = null;
		aClass3_1369 = null;
		aClass9_1362 = null;
		anIntArray1355 = null;
		aClass9_Sub1_1358 = null;
		aClass3_1360 = null;
		aClass3_1354 = null;
		aClass3_1366 = null;
		aClass3_1363 = null;
		aClass3_1359 = null;
		aClass3_1370 = null;
		aClass3_1356 = null;
	}

	public void readBytesReversed(int i, byte[] is, int i_4_) {
		for (int i_5_ = i_4_ + i - 1; i_5_ >= i_4_; i_5_--)
			is[i_5_] = buffer[currentOffset++];
	}

	public int readByte(byte i) {
		return buffer[currentOffset++] & 0xff;
	}

	public void method785(int i, int i_6_) {
		buffer[currentOffset++] = (byte) -i_6_;
	}

	public void writeShortLE(int i) {
		buffer[currentOffset++] = (byte) i;
		buffer[currentOffset++] = (byte) (i >> 8);
	}

	public static void method787(int i) {
		RuntimeException_Sub1.aClass7_1220.method134(27392);
	}

	public int readByteA(byte i) {
		return buffer[currentOffset++] - 128 & 0xff;
	}

	public void writeIntLE(int i, int i_8_) {
		buffer[currentOffset++] = (byte) i;
		buffer[currentOffset++] = (byte) (i >> i_8_);
		buffer[currentOffset++] = (byte) (i >> 16);
		buffer[currentOffset++] = (byte) (i >> 24);
	}

	public void writeBytes(int offset, byte[] bytes, int length) {
		for (int i_11_ = offset; i_11_ < length + offset; i_11_++)
			buffer[currentOffset++] = bytes[i_11_];
	}

	public int method791(int i, int i_12_) {
		int i_13_ = Login.method282(currentOffset, (byte) 72, i_12_, buffer);
		writeInt(i_13_);
		return i_13_;
	}

	public int readSignedShort(boolean bool) {
		currentOffset += 2;
		int i = ((buffer[currentOffset - 2] << 8 & 0xff00) + (buffer[currentOffset - 1] - 128 & 0xff));
		if (i > 32767)
			i -= 65536;
		return i;
	}

	public int read3Bytes(byte i) {
		currentOffset += 3;
		return ((buffer[currentOffset - 2] << 8 & 0xff00) + ((buffer[currentOffset - 3] << 16 & 0xff0000) + (buffer[currentOffset - 1] & 0xff)));
	}

	public int readSignedShortLE(byte i) {
		currentOffset += 2;
		int i_14_ = (((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff));
		if (i_14_ > 32767)
			i_14_ -= 65536;
		return i_14_;
	}

	public long readLong() {
		long l = (long) readInt() & 0xffffffffL;
		long l_15_ = (long) readInt() & 0xffffffffL;
		return l_15_ + (l << 32);
	}

	public void writeShortLEA(int i_16_) {
		buffer[currentOffset++] = (byte) (i_16_ + 128);
		buffer[currentOffset++] = (byte) (i_16_ >> 8);
	}

	public void writeByteS(int i) {
		buffer[currentOffset++] = (byte) (-i + 128);
	}

	public int method798(int i) {
		int i_17_ = buffer[currentOffset++];
		int i_18_ = 0;
		for (/**/; i_17_ < 0; i_17_ = buffer[currentOffset++])
			i_18_ = (i_18_ | i_17_ & 0x7f) << 7;
		return i_17_ | i_18_;
	}

	public byte readSignedByteS(int i) {
		return (byte) (128 - buffer[currentOffset++]);
	}

	public int readShort(int i) {
		currentOffset += 2;
		return ((buffer[currentOffset - 1] & 0xff) + ((buffer[currentOffset - 2] & 0xff) << 8));
	}

	public int readShortLE(int i) {
		currentOffset += 2;
		return ((buffer[currentOffset - 1] << 8 & 0xff00) + (buffer[currentOffset - 2] & 0xff));
	}

	public byte readSignedByte(int i) {
		return buffer[currentOffset++];
	}

	public void writeLong(boolean bool, long l) {
		buffer[currentOffset++] = (byte) (int) (l >> 56);
		buffer[currentOffset++] = (byte) (int) (l >> 48);
		buffer[currentOffset++] = (byte) (int) (l >> 40);
		buffer[currentOffset++] = (byte) (int) (l >> 32);
		buffer[currentOffset++] = (byte) (int) (l >> 24);
		buffer[currentOffset++] = (byte) (int) (l >> 16);
		buffer[currentOffset++] = (byte) (int) (l >> 8);
		buffer[currentOffset++] = (byte) (int) l;
	}

	public int readByteS() {
		return -buffer[currentOffset++] + 128 & 0xff;
	}

	public void writeByte(byte i, int i_20_) {
		buffer[currentOffset++] = (byte) i_20_;
	}

	public void write3Bytes(int i_21_) {
		buffer[currentOffset++] = (byte) (i_21_ >> 16);
		buffer[currentOffset++] = (byte) (i_21_ >> 8);
		buffer[currentOffset++] = (byte) i_21_;
	}

	public void decryptXTEA(int[] is, int i, int i_22_, int i_23_) {
		int i_24_ = currentOffset;
		int i_25_ = (i_22_ - i_23_) / 8;
		currentOffset = i_23_;
		for (int i_26_ = i; i_25_ > i_26_; i_26_++) {
			int i_27_ = readInt();
			int i_28_ = 32;
			int i_29_ = -957401312;
			int i_30_ = -1640531527;
			int i_31_ = readInt();
			while (i_28_-- > 0) {
				i_31_ -= (is[(i_29_ & 0x1ff1) >>> 11] + i_29_ ^ i_27_ + (i_27_ << 4 ^ i_27_ >>> 5));
				i_29_ -= i_30_;
				i_27_ -= (i_31_ + (i_31_ << 4 ^ i_31_ >>> 5) ^ i_29_ + is[i_29_ & 0x3]);
			}
			currentOffset -= 8;
			writeInt(i_27_);
			writeInt(i_31_);
		}
		currentOffset = i_24_;
	}

	public void writeInt(int i) {
		buffer[currentOffset++] = (byte) (i >> 24);
		buffer[currentOffset++] = (byte) (i >> 16);
		buffer[currentOffset++] = (byte) (i >> 8);
		buffer[currentOffset++] = (byte) i;
	}

	public int readSignedShort() {
		currentOffset += 2;
		int i_33_ = ((buffer[currentOffset - 1] & 0xff) + (buffer[currentOffset - 2] << 8 & 0xff00));
		if (i_33_ > 32767)
			i_33_ -= 65536;
		return i_33_;
	}

	public byte readSignedByteC() {
		return (byte) -buffer[currentOffset++];
	}

	public int readInt() {
		currentOffset += 4;
		return (((buffer[currentOffset - 2] & 0xff) << 8) + ((buffer[currentOffset - 3] & 0xff) << 16) + (buffer[currentOffset - 4] << 24 & ~0xffffff) + (buffer[currentOffset - 1] & 0xff));
	}

	public int readInt2() {
		currentOffset += 4;
		return (((buffer[currentOffset - 1] & 0xff) << 8) + ((buffer[currentOffset - 4] & 0xff) << 16) + (((buffer[currentOffset - 3] & 0xff) << 24) + (buffer[currentOffset - 2] & 0xff)));
	}

	public byte readSignedByteA(byte i) {
		return (byte) (buffer[currentOffset++] - 128);
	}

	public static void method814(int i) {
		while (Class39_Sub5_Sub7.method588(-4)) {
			if (Class39_Sub11.openInterface == -1 || Class26.anInt473 != Class39_Sub11.openInterface) {
				if (!Class39_Sub12.aBoolean1489) {
					if (GameCharacter.anInt2285 != 1) {
						if (GameCharacter.anInt2285 == 2) {
							if (Class15.anInt287 == 85 && Class66.aClass3_1151.length() > 0) {
								Class66.aClass3_1151 = (Class66.aClass3_1151.substring(0, Class66.aClass3_1151.length() - 1));
								Class14.aBoolean245 = true;
							}
							if ((Class37.method352((byte) 56, (Class39_Sub5_Sub4_Sub1.anInt2191)) || Class39_Sub5_Sub4_Sub1.anInt2191 == 32) && Class66.aClass3_1151.length() < 12) {
								Class66.aClass3_1151 = (Class66.aClass3_1151.concatChar(Class39_Sub5_Sub4_Sub1.anInt2191));
								Class14.aBoolean245 = true;
							}
							if (Class15.anInt287 == 84) {
								if (Class66.aClass3_1151.length() > 0) {
									PacketStream.outputStream.writePacket(22);
									PacketStream.outputStream.writeLong(true, Class66.aClass3_1151.toInt64());
								}
								GameCharacter.anInt2285 = 0;
								Class14.aBoolean245 = true;
							}
						} else if (GameCharacter.anInt2285 != 3) {
							if (Tile.anInt1912 == -1 && Class39_Sub5.anInt1348 == -1) {
								if (Class15.anInt287 == 85 && (Class66.chatText.length() > 0)) {
									Class66.chatText = (Class66.chatText.substring(0, Class66.chatText.length() - 1));
									Class14.aBoolean245 = true;
								}
								if (Class26.method290((Class39_Sub5_Sub4_Sub1.anInt2191), -160) && (Class66.chatText.length() < 80)) {
									Class66.chatText = (Class66.chatText.concatChar(Class39_Sub5_Sub4_Sub1.anInt2191));
									Class14.aBoolean245 = true;
								}
								if (Class15.anInt287 == 84 && (Class66.chatText.length() > 0)) {
									if (CacheIO.anInt97 == 2) {
										if (Class66.chatText.equals(Class39_Sub5_Sub18.aClass3_2138))
											Class37.method354((byte) 81);
										if (Class66.chatText.equals((Class39_Sub5_Sub4_Sub2.aClass3_2213)))
											Class39_Sub5_Sub3.aBoolean1718 = true;
										if (Class66.chatText.equals(Class32.aClass3_588))
											Class39_Sub5_Sub3.aBoolean1718 = false;
										if (Class66.chatText.equals(Class11.aClass3_185)) {
											for (int i_34_ = 0; i_34_ < 4; i_34_++) {
												for (int i_35_ = 1; i_35_ < 103; i_35_++) {
													for (int i_36_ = 1; i_36_ < 103; i_36_++)
														Class39_Sub5_Sub12.aClass27Array1857[i_34_].anIntArrayArray507[i_35_][i_36_] = 0;
												}
											}
										}
										if ((Class66.chatText.equals(Class39_Sub5_Sub18.aClass3_2123)) && (Class39_Sub5_Sub6.anInt1772 == 2))
											throw new RuntimeException();
										if (Class66.chatText.equals(Class39_Sub9.aClass3_1414))
											Class19.aBoolean361 = true;
									}
									if (Class66.chatText.startsWith(Class10.commandStart)) {
										PacketStream.outputStream.writePacket(174);
										PacketStream.outputStream.writeByte((byte) -28, Class66.chatText.length() - 1);
										PacketStream.outputStream.writeString((byte) 81, Class66.chatText.substring(2));
									} else {
										int i_37_ = 0;
										int i_38_ = 0;
										JString class3 = Class66.chatText.toLowerCase();
										if (!class3.startsWith((Class39_Sub5_Sub4_Sub2.aClass3_2218))) {
											if (class3.startsWith(Class39_Sub12.aClass3_1485)) {
												Class66.chatText = (Class66.chatText.substring(Class39_Sub12.aClass3_1485.length()));
												i_37_ = 1;
											} else if (!class3.startsWith(Class42.aClass3_795)) {
												if (!class3.startsWith(RSSocket.aClass3_308)) {
													if (class3.startsWith((Class39_Sub5_Sub4_Sub4_Sub1.aClass3_2496))) {
														i_37_ = 4;
														Class66.chatText = (Class66.chatText.substring((Class39_Sub5_Sub4_Sub4_Sub1.aClass3_2496.length())));
													} else if (class3.startsWith((Canvas_Sub1.aClass3_13))) {
														i_37_ = 5;
														Class66.chatText = (Class66.chatText.substring((Canvas_Sub1.aClass3_13.length())));
													} else if (class3.startsWith((Class57_Sub2.aClass3_1585))) {
														Class66.chatText = (Class66.chatText.substring((Class57_Sub2.aClass3_1585.length())));
														i_37_ = 6;
													} else if (class3.startsWith((Class39_Sub10.aClass3_1448))) {
														i_37_ = 7;
														Class66.chatText = (Class66.chatText.substring((Class39_Sub10.aClass3_1448.length())));
													} else if (class3.startsWith((Class13.aClass3_198))) {
														Class66.chatText = (Class66.chatText.substring((Class13.aClass3_198.length())));
														i_37_ = 8;
													} else if (class3.startsWith((PacketStream.aClass3_2144))) {
														Class66.chatText = (Class66.chatText.substring((PacketStream.aClass3_2144.length())));
														i_37_ = 9;
													} else if (class3.startsWith((Class63.aClass3_1129))) {
														Class66.chatText = (Class66.chatText.substring((Class63.aClass3_1129.length())));
														i_37_ = 10;
													} else if (class3.startsWith((Class39_Sub5_Sub7.aClass3_1787))) {
														i_37_ = 11;
														Class66.chatText = (Class66.chatText.substring((Class39_Sub5_Sub7.aClass3_1787.length())));
													}
												} else {
													Class66.chatText = (Class66.chatText.substring((RSSocket.aClass3_308.length())));
													i_37_ = 3;
												}
											} else {
												i_37_ = 2;
												Class66.chatText = (Class66.chatText.substring(Class42.aClass3_795.length()));
											}
										} else {
											i_37_ = 0;
											Class66.chatText = (Class66.chatText.substring(Class39_Sub5_Sub4_Sub2.aClass3_2218.length()));
										}
										class3 = Class66.chatText.toLowerCase();
										if (class3.startsWith((Class53.aClass3_958))) {
											i_38_ = 1;
											Class66.chatText = (Class66.chatText.substring(Class53.aClass3_958.length()));
										} else if (class3.startsWith((Class39_Sub5_Sub12.aClass3_1850))) {
											Class66.chatText = (Class66.chatText.substring(Class39_Sub5_Sub12.aClass3_1850.length()));
											i_38_ = 2;
										} else if (class3.startsWith(Class46.aClass3_877)) {
											Class66.chatText = (Class66.chatText.substring(Class46.aClass3_877.length()));
											i_38_ = 3;
										} else if (class3.startsWith(Class55.aClass3_1253)) {
											Class66.chatText = (Class66.chatText.substring(Class55.aClass3_1253.length()));
											i_38_ = 4;
										} else if (class3.startsWith(Class34.aClass3_615)) {
											i_38_ = 5;
											Class66.chatText = (Class66.chatText.substring(Class34.aClass3_615.length()));
										}
										PacketStream.outputStream.writePacket(4);
										PacketStream.outputStream.writeByte((byte) -28, 0);
										int i_39_ = (PacketStream.outputStream.currentOffset);
										PacketStream.outputStream.writeByte((byte) -28, i_37_);
										PacketStream.outputStream.writeByte((byte) -28, i_38_);
										Class68.method1113((PacketStream.outputStream), Class66.chatText, -110);
										PacketStream.outputStream.method816((PacketStream.outputStream.currentOffset) - i_39_, -12139);
										if (PacketParser.publicChatOptions == 2) {
											GameCharacter.chatOptionsNeedRedraw = true;
											PacketParser.publicChatOptions = 3;
											Class39_Sub5_Sub4_Sub1.anInt2203++;
											PacketStream.outputStream.writePacket(76);
											PacketStream.outputStream.writeByte((byte) -28, PacketParser.publicChatOptions);
											PacketStream.outputStream.writeByte((byte) -28, Class11.privateChatOptions);
											PacketStream.outputStream.writeByte((byte) -28, Class7.tradeCompeteOptions);
										}
									}
									Class14.aBoolean245 = true;
									Class66.chatText = Class66.aClass3_1164;
								}
							}
						} else {
							if (Class15.anInt287 == 85 && Class66.aClass3_1151.length() > 0) {
								Class66.aClass3_1151 = (Class66.aClass3_1151.substring(0, (Class66.aClass3_1151.length() - 1)));
								Class14.aBoolean245 = true;
							}
							if (Class26.method290((Class39_Sub5_Sub4_Sub1.anInt2191), i ^ ~0xf8) && Class66.aClass3_1151.length() < 40) {
								Class66.aClass3_1151 = (Class66.aClass3_1151.concatChar(Class39_Sub5_Sub4_Sub1.anInt2191));
								Class14.aBoolean245 = true;
							}
						}
					} else {
						if (Class15.anInt287 == 85 && Class66.aClass3_1151.length() > 0) {
							Class66.aClass3_1151 = (Class66.aClass3_1151.substring(0, Class66.aClass3_1151.length() - 1));
							Class14.aBoolean245 = true;
						}
						if (Class43.method909(Class39_Sub5_Sub4_Sub1.anInt2191, -86) && Class66.aClass3_1151.length() < 10) {
							Class66.aClass3_1151 = (Class66.aClass3_1151.concatChar(Class39_Sub5_Sub4_Sub1.anInt2191));
							Class14.aBoolean245 = true;
						}
						if (Class15.anInt287 == 84) {
							if (Class66.aClass3_1151.length() > 0) {
								int i_40_ = 0;
								if (Class66.aClass3_1151.isNumber(22415))
									i_40_ = Class66.aClass3_1151.parseInt();
								PacketStream.outputStream.writePacket(74);
								PacketStream.outputStream.writeInt(i_40_);
							}
							GameCharacter.anInt2285 = 0;
							Class14.aBoolean245 = true;
						}
					}
				} else {
					if (Class15.anInt287 == 85 && Class66.aClass3_1154.length() > 0) {
						Class66.aClass3_1154 = (Class66.aClass3_1154.substring(0, Class66.aClass3_1154.length() - 1));
						Class14.aBoolean245 = true;
					}
					if (Class26.method290(Class39_Sub5_Sub4_Sub1.anInt2191, i ^ ~0xf8) && Class66.aClass3_1154.length() < 80) {
						Class66.aClass3_1154 = (Class66.aClass3_1154.concatChar(Class39_Sub5_Sub4_Sub1.anInt2191));
						Class14.aBoolean245 = true;
					}
					if (Class15.anInt287 == 84) {
						Class14.aBoolean245 = true;
						Class39_Sub12.aBoolean1489 = false;
						if (Class15.anInt277 == 1) {
							long l = Class66.aClass3_1154.toInt64();
							Class68.method1111(0, l);
						}
						if (Class15.anInt277 == 2 && Class4.anInt62 > 0) {
							long l = Class66.aClass3_1154.toInt64();
							Class20.method246(l, (byte) -123);
						}
						if (Class15.anInt277 == 3 && Class66.aClass3_1154.length() > 0) {
							PacketStream.outputStream.writePacket(50);
							PacketStream.outputStream.writeByte((byte) -28, 0);
							int i_41_ = (PacketStream.outputStream.currentOffset);
							PacketStream.outputStream.writeLong(true, Class40.aLong752);
							Class68.method1113((PacketStream.outputStream), Class66.aClass3_1154, -126);
							PacketStream.outputStream.method816(-i_41_ + (PacketStream.outputStream.currentOffset), -12139);
							if (Class11.privateChatOptions == 2) {
								GameCharacter.chatOptionsNeedRedraw = true;
								Class39_Sub5_Sub4_Sub1.anInt2203++;
								Class11.privateChatOptions = 1;
								PacketStream.outputStream.writePacket(76);
								PacketStream.outputStream.writeByte((byte) -28, PacketParser.publicChatOptions);
								PacketStream.outputStream.writeByte((byte) -28, Class11.privateChatOptions);
								PacketStream.outputStream.writeByte((byte) -28, Class7.tradeCompeteOptions);
							}
						}
						if (Class15.anInt277 == 4 && Class15.anInt282 < 100) {
							long l = Class66.aClass3_1154.toInt64();
							Class65.method1097(0, l);
						}
						if (Class15.anInt277 == 5 && Class15.anInt282 > 0) {
							long l = Class66.aClass3_1154.toInt64();
							Class19.method237(l, (byte) -58);
						}
					}
				}
			} else {
				if (Class15.anInt287 == 85 && Class66.aClass3_1163.length() > 0)
					Class66.aClass3_1163 = (Class66.aClass3_1163.substring(0, Class66.aClass3_1163.length() - 1));
				if ((Class37.method352((byte) 56, Class39_Sub5_Sub4_Sub1.anInt2191) || Class39_Sub5_Sub4_Sub1.anInt2191 == 32) && Class66.aClass3_1163.length() < 12)
					Class66.aClass3_1163 = Class66.aClass3_1163.concatChar((Class39_Sub5_Sub4_Sub1.anInt2191));
			}
		}
		if (i != 103)
			aClass3_1366 = null;
	}

	public int readByteC(byte i) {
		return -buffer[currentOffset++] & 0xff;
	}

	public void method816(int i, int i_42_) {
		buffer[-i + currentOffset - 1] = (byte) i;
	}

	public int readByteOrSignedShort(byte i) {
		int i_43_ = buffer[currentOffset] & 0xff;
		if (i_43_ < 128)
			return readByte((byte) -8) - 64;
		return readShort(2) - 49152;
	}

	public int readShortA(int i) {
		currentOffset += 2;
		return ((buffer[currentOffset - 1] - 128 & 0xff) + (buffer[currentOffset - 2] << 8 & 0xff00));
	}

	public void writeInt1(int i) {
		buffer[currentOffset++] = (byte) (i >> 8);
		buffer[currentOffset++] = (byte) i;
		buffer[currentOffset++] = (byte) (i >> 24);
		buffer[currentOffset++] = (byte) (i >> 16);
	}

	public int readSignedShortLEA(int i) {
		currentOffset += 2;
		int i_45_ = ((buffer[currentOffset + i] << 8 & 0xff00) + (buffer[currentOffset - 2] - 128 & 0xff));
		if (i_45_ > 32767)
			i_45_ -= 65536;
		return i_45_;
	}

	public int readIntLE() {
		currentOffset += 4;
		return ((buffer[currentOffset - 4] & 0xff) + (((buffer[currentOffset - 2] & 0xff) << 16) + (buffer[currentOffset - 1] << 24 & ~0xffffff)) + ((buffer[currentOffset - 3] & 0xff) << 8));
	}

	public int read3Bytes1(byte i) {
		currentOffset += 3;
		return ((buffer[currentOffset - 2] & 0xff) + (buffer[currentOffset - 1] << 8 & 0xff00) + (buffer[currentOffset - 3] << 16 & 0xff0000));
	}

	public static void method823(int i) {
		if (Class39_Sub5_Sub2.aBoolean1690) {
			Class39_Sub5_Sub2.aBoolean1690 = false;
			Class39_Sub5_Sub8.method590(false);
			Class14.aBoolean245 = true;
			GameCharacter.chatOptionsNeedRedraw = true;
			Class39_Sub14.aBoolean1520 = true;
			ISAAC.aBoolean1089 = true;
		}
		Class39_Sub5_Sub7.method589((byte) 101);
		if (Class39_Sub12.aBoolean1493 && Class37.anInt653 == 1)
			Class39_Sub14.aBoolean1520 = true;
		if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != -1) {
			boolean bool = Class39_Sub4.method459(Class39_Sub5_Sub4_Sub5.openSidebarInterface, (byte) 120);
			if (bool)
				Class39_Sub14.aBoolean1520 = true;
		}
		if (Login.anInt459 == 2)
			Class39_Sub14.aBoolean1520 = true;
		if (Class30.anInt534 == 2)
			Class39_Sub14.aBoolean1520 = true;
		if (Class39_Sub14.aBoolean1520) {
			Class39_Sub14.aBoolean1520 = false;
			RuntimeException_Sub1.method1124((byte) 44);
		}
		if (Tile.anInt1912 == -1) {
			Class65.aClass39_Sub5_Sub17_1136.anInt1994 = -Node.anInt741 - 77 + Deque.anInt912;
			if (ISAAC.anInt1091 > 17 && ISAAC.anInt1091 < 560 && Class33.anInt599 > 332)
				Class39_Sub4.method456((byte) 121, 463, ISAAC.anInt1091 - 17, Class33.anInt599 - 357, -1, 77, 0, Deque.anInt912, Class65.aClass39_Sub5_Sub17_1136);
			int i_46_ = (-Class65.aClass39_Sub5_Sub17_1136.anInt1994 + (Deque.anInt912 - 77));
			if (i_46_ < 0)
				i_46_ = 0;
			if (i_46_ > Deque.anInt912 - 77)
				i_46_ = Deque.anInt912 - 77;
			if (Node.anInt741 != i_46_) {
				Class14.aBoolean245 = true;
				Node.anInt741 = i_46_;
			}
		}
		if (Tile.anInt1912 == -1 && GameCharacter.anInt2285 == 3) {
			Class65.aClass39_Sub5_Sub17_1136.anInt1994 = Class39_Sub14.anInt1511;
			int i_47_ = Class67.anInt1184 * 14 + 7;
			if (ISAAC.anInt1091 > 17 && ISAAC.anInt1091 < 560 && Class33.anInt599 > 332)
				Class39_Sub4.method456((byte) 121, 463, ISAAC.anInt1091 - 17, Class33.anInt599 - 357, -1, 77, 0, i_47_, Class65.aClass39_Sub5_Sub17_1136);
			int i_48_ = Class65.aClass39_Sub5_Sub17_1136.anInt1994;
			if (i_48_ < 0)
				i_48_ = 0;
			if (i_47_ - 77 < i_48_)
				i_48_ = i_47_ - 77;
			if (i_48_ != Class39_Sub14.anInt1511) {
				Class39_Sub14.anInt1511 = i_48_;
				Class14.aBoolean245 = true;
			}
		}
		if (i != (Tile.anInt1912 ^ 0xffffffff)) {
			boolean bool = Class39_Sub4.method459(Tile.anInt1912, (byte) 115);
			if (bool)
				Class14.aBoolean245 = true;
		}
		if (Login.anInt459 == 3)
			Class14.aBoolean245 = true;
		if (Class30.anInt534 == 3)
			Class14.aBoolean245 = true;
		if (Class39_Sub5_Sub3.aClass3_1714 != null)
			Class14.aBoolean245 = true;
		if (Class39_Sub12.aBoolean1493 && Class37.anInt653 == 2)
			Class14.aBoolean245 = true;
		if (Class14.aBoolean245) {
			Class14.aBoolean245 = false;
			Class32.method325((byte) -85);
		}
		RSInterface.method761((byte) 45);
		if (Class39_Sub5_Sub2.anInt1703 != -1)
			ISAAC.aBoolean1089 = true;
		if (ISAAC.aBoolean1089) {
			if (Class39_Sub5_Sub2.anInt1703 != -1 && Class39_Sub5_Sub2.anInt1703 == Node.anInt728) {
				Class39_Sub5_Sub2.anInt1703 = -1;
				PacketStream.outputStream.writePacket(65);
				PacketStream.outputStream.writeByte((byte) -28, Node.anInt728);
			}
			Class11.aBoolean183 = true;
			ISAAC.aBoolean1089 = false;
			Class39_Sub5_Sub16.method748(Tile.anIntArray1914, (Class39_Sub5_Sub4_Sub5.openSidebarInterface == -1), (byte) 82, (Class2.anInt48 % 20 >= 10 ? Class39_Sub5_Sub2.anInt1703 : -1), Node.anInt728);
		}
		if (GameCharacter.chatOptionsNeedRedraw) {
			Class11.aBoolean183 = true;
			GameCharacter.chatOptionsNeedRedraw = false;
			OnDemandFetcher.drawBottomChatOptions(Class7.tradeCompeteOptions, PacketParser.publicChatOptions, (Tile.aClass39_Sub5_Sub10_Sub1_1903), 41, Class11.privateChatOptions);
		}
		Class39_Sub5_Sub4_Sub4_Sub1.method520(-118, Class45.anInt856, Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.anInt2301, Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.anInt2275, Class11.currentPlane);
		Class45.anInt856 = 0;
	}

	public JString readString() {
		int i_49_ = currentOffset;
		while (buffer[currentOffset++] != 0) {
			/* empty */
		}
		return Class19.method240((byte) -127, buffer, i_49_, currentOffset + (-i_49_ - 1));
	}

	public void readBytes(byte[] dest, int length, int offset) {
		for (int i_51_ = offset; i_51_ < offset + length; i_51_++)
			dest[i_51_] = buffer[currentOffset++];
	}

	public int readByteOrShort() {
		int i_52_ = buffer[currentOffset] & 0xff;
		if (i_52_ >= 128)
			return readShort(120) - 32768;
		return readByte((byte) -8);
	}

	public void writeInt2(int i, int i_53_) {
		buffer[currentOffset++] = (byte) (i >> 16);
		buffer[currentOffset++] = (byte) (i >> 24);
		buffer[currentOffset++] = (byte) i;
		buffer[currentOffset++] = (byte) (i >> i_53_);
	}

	public void rsaEncrypt(BigInteger biginteger, BigInteger biginteger_54_, int i) {
		int i_55_ = currentOffset;
		currentOffset = 0;
		byte[] is = new byte[i_55_];
		if (i != -17694)
			aClass3_1370 = null;
		readBytes(is, i_55_, 0);
		BigInteger biginteger_56_ = new BigInteger(is);
		BigInteger biginteger_57_ = biginteger_56_.modPow(biginteger, biginteger_54_);
		byte[] is_58_ = biginteger_57_.toByteArray();
		currentOffset = 0;
		writeByte((byte) -28, is_58_.length);
		writeBytes(0, is_58_, is_58_.length);
	}

	public Stream(int i) {
		buffer = Class4.method99((byte) 68, i);
		currentOffset = 0;
	}

	public Stream(byte[] is) {
		buffer = is;
		currentOffset = 0;
	}

	public int readInt1() {
		currentOffset += 4;
		return ((buffer[currentOffset - 3] & 0xff) + (buffer[currentOffset - 4] << 8 & 0xff00) + ((buffer[currentOffset - 1] << 16 & 0xff0000) + ((buffer[currentOffset - 2] & 0xff) << 24)));
	}

	public void writeByteOrShort(byte i, int i_59_) {
		if (i_59_ >= 0 && i_59_ < 128)
			writeByte((byte) -28, i_59_);
		else if (i_59_ >= 0 && i_59_ < 32768)
			writeShort(i_59_ + 32768);
		else
			throw new IllegalArgumentException();
	}

	public void writeShort(int i_60_) {
		buffer[currentOffset++] = (byte) (i_60_ >> 8);
		buffer[currentOffset++] = (byte) i_60_;
	}

	public void writeShortA(int i, byte i_61_) {
		buffer[currentOffset++] = (byte) (i >> 8);
		buffer[currentOffset++] = (byte) (i + 128);
	}

	public int readShortLEA(byte i) {
		currentOffset += 2;
		return (((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] - 128 & 0xff));
	}

	public void writeString(byte i, JString class3) {
		currentOffset += class3.copy(40, 0, buffer, currentOffset, class3.length());
		buffer[currentOffset++] = (byte) 0;
	}

	static {
		aClass3_1360 = Class39_Sub5_Sub9.createJString(107, "(U(Y");
		aClass3_1354 = Class39_Sub5_Sub9.createJString(117, "Unable to find ");
		aClass3_1359 = Class39_Sub5_Sub9.createJString(104, "lila:");
		anInt1364 = 0;
		aClass3_1363 = Class39_Sub5_Sub9.createJString(103, "Benutzeroberfl-=che geladen)3");
		aClass3_1366 = Class39_Sub5_Sub9.createJString(106, "0(U");
		aClass3_1365 = aClass3_1354;
		aClass3_1370 = Class39_Sub5_Sub9.createJString(111, "null");
		aClass3_1369 = Class39_Sub5_Sub9.createJString(119, "T");
		anInt1368 = 0;
	}
}
